from com.arcfox.school.processor.base_processor import BaseProcessor


class HandMajorWorkerProcessor(BaseProcessor):
    def __init__(self):
        pass

    async def parse_and_save_data(self, task, result_json):
        result_data = result_json['data']
        # 选科建议
        subject_advice = result_data['sel_adv']
        job_detail = result_data['jobdetail']
        # 行业
        job_hang_ye = job_detail['1']
        for item in job_hang_ye:
            name = item['name']
            rate = item['rate']
        # 区域
        job_area = job_detail['2']
        for item in job_area:
            area = item['area']
            rate = item['rate']
        # 职业
        job_zhi_ye = job_detail['3']
        for item in job_zhi_ye:
            detail_pos = item['detail_pos']
            rate = item['rate']
            name = item['name']
            detail_job = item['detail_job']
        # 就业率
        job_rate = result_data['jobrate']
        for item in job_rate:
            year = item['year']
            rate = item['rate']

    async def update_major_info(self, task, subject_advice):
        pass
